﻿using System.Globalization;
using System.Windows.Data;

namespace TianlalaHSB.ViewModels;

public class TrTypeConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is string)
            return value switch
            {
                "02" => "收费",
                "03" => "结息",
                "04" => "退款",
                "23" => "虚户间转账（交易）",
                "41" => "线下充值入金",
                "42" => "线上网关充值",
                "43" => "线上快捷充值",
                "45" => "线上通知入金",
                "51" => "直接提现",
                "52" => "审核提现",
                "53" => "退款提现",
                _ => ""
            };
        return "";
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        // 如果需要双向转换，这里实现转换回bool的逻辑
        throw new NotImplementedException();
    }
}